package vell.velllock.util;

import java.util.Timer;
import java.util.TimerTask;

import vell.velllock.activity.VellLock;

import android.content.Context;
import android.content.Intent;

public class VellLockUtil {
	public static void startService(final Context mContext, Class<?> serviceClass){
		final Intent mIntent = new Intent(mContext, serviceClass);
		mContext.startService(mIntent);
		Timer timer = new Timer();
		timer.schedule(new TimerTask() {
			@Override
			public void run() {
				mContext.startService(mIntent);
				this.cancel();
			}
		}, 30000);
	}
	
	public static void startActivity(final Context context, Class<?> activityClass){
		final Intent intent = new Intent(context, activityClass);
		intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		intent.setClass(context, VellLock.class);
		context.startActivity(intent);
	}
}
